﻿
@functions{
    public MvcHtmlString GetSelectedMenuClass(JobSeekerMenu currentMenu, JobSeekerMenu selectedMenu)
    {        
        if (currentMenu == selectedMenu)
            return MvcHtmlString.Create(" class=\"active\"");

        return MvcHtmlString.Empty;
    }
    public MvcHtmlString GetSelectedMenuClass(EmployerMenu currentMenu, EmployerMenu selectedMenu)
    {        
        if (currentMenu == selectedMenu)
            return MvcHtmlString.Create(" class=\"active\"");

        return MvcHtmlString.Empty;
    }
    public MvcHtmlString GetSelectedMenuClass(AdminMenu currentMenu, AdminMenu selectedMenu)
    {
        if (currentMenu == selectedMenu)
            return MvcHtmlString.Create(" class=\"active\"");

        return MvcHtmlString.Empty;
    }
}


@if (SessionCache.CurrentUser != null)
{   
    <ul class="nav nav-list jb-sidenav affix jb-shadow jb-border-radius">
        @if (UserInfo.IsCompanyUser)
        {
            EmployerMenu selectedMenu = EmployerMenu.None;
            if (ViewData[AppConstants.ViewDataKeys.SELECTED_MENU] != null)
            {
                selectedMenu = (EmployerMenu)ViewData[AppConstants.ViewDataKeys.SELECTED_MENU];
            }
            <li@GetSelectedMenuClass(EmployerMenu.Dashboard, selectedMenu)><a href="@Url.PrivateUrl("dashboard", "account")"><i class="icon-chevron-right"></i> Dashboard</a></li>      
            <li@GetSelectedMenuClass(EmployerMenu.CompanyProfile, selectedMenu)><a href="@Url.PrivateUrl("ProfileEdit", "Company")"><i class="icon-chevron-right"></i> Company Profile</a></li>
            <li@GetSelectedMenuClass(EmployerMenu.ManageContacts, selectedMenu)><a href="@Url.PrivateUrl("List", "Contact")"><i class="icon-chevron-right"></i> Manage Contacts</a></li>
            <li@GetSelectedMenuClass(EmployerMenu.ManageJobs, selectedMenu)><a href="@Url.PrivateUrl("List", "Job")"><i class="icon-chevron-right"></i><span class="badge pull-right" id="span_LM_Total_Job">@SessionCache.CurrentUser.EmployerInfo.TotalJobs</span> Manage Jobs</a></li>            
            @*<li@GetSelectedMenuClass(EmployerMenu.PublishedJobs, selectedMenu)><a href="@Url.PrivateUrl("PublishedJobs", "Job")"><i class="icon-chevron-right"></i><span class="badge pull-right" id="span_LM_Total_P_Jobs">@SessionCache.CurrentUser.EmployerInfo.TotalActiveJobs</span> Published Jobs</a></li>*@
            <li@GetSelectedMenuClass(EmployerMenu.ManageApplications, selectedMenu)><a href="@Url.PrivateUrl("FullList", "JobApplication")"><i class="icon-chevron-right"></i> Manage Applications</a></li>            
            @*<li>@Html.PrivateLink("Manage Users", "List", "User")</li>*@
            <li@GetSelectedMenuClass(EmployerMenu.SearchResume, selectedMenu)><a href="@Url.PrivateUrl("Search", "Resume")"><i class="icon-chevron-right"></i> Search Resumes</a></li> 
            <li@GetSelectedMenuClass(EmployerMenu.FavoriteResumes, selectedMenu)><a href="@Url.PrivateUrl("Favorites", "Resume")"><i class="icon-chevron-right"></i> Favorite Resumes</a></li>            
            @*<li@GetSelectedMenuClass(EmployerMenu.FavoriteJobSeekers, selectedMenu)><a href="@Url.PrivateUrl("Favorite", "JobSeeker")"><i class="icon-chevron-right"></i> Favorite Jobseekers</a></li>*@
            <li@GetSelectedMenuClass(EmployerMenu.Subscriptions, selectedMenu)><a href="@Url.PrivateUrl("Status", "Package")"><i class="icon-chevron-right"></i> Subscriptions</a></li>
            @*<li@GetSelectedMenuClass(EmployerMenu.Settings, selectedMenu)><a href="@Url.PrivateUrl("List", "Settings")"><i class="icon-chevron-right"></i> Settings</a></li> *@
            @*<li><a href="#"><i class="icon-chevron-right"></i> Settings</a></li>
            <li><a href="#"><i class="icon-chevron-right"></i> Settings</a></li>
            <li><a href="#"><i class="icon-chevron-right"></i> Settings</a></li>*@
        }
        else if (UserInfo.IsAdmin)
        {
            AdminMenu selectedMenu = AdminMenu.None;
            if (ViewData[AppConstants.ViewDataKeys.SELECTED_MENU] != null)
            {
                selectedMenu = (AdminMenu)ViewData[AppConstants.ViewDataKeys.SELECTED_MENU];
            }
            <li@GetSelectedMenuClass(AdminMenu.Dashboard, selectedMenu)><a href="@Url.AdminUrl("dashboard", "account")"><i class="icon-chevron-right"></i> Dashboard</a></li>
            <li@GetSelectedMenuClass(AdminMenu.ManageCategory, selectedMenu)><a href="@Url.AdminUrl("List", "Category")"><i class="icon-chevron-right"></i> Manage Categories</a></li>
            @*<li@GetSelectedMenuClass(AdminMenu.None, selectedMenu)><a href="@Url.AdminUrl("List", "IndustryType")"><i class="icon-chevron-right"></i> Manage Industry Types</a></li>*@
            <li@GetSelectedMenuClass(AdminMenu.ManagePackage, selectedMenu)><a href="@Url.AdminUrl("List", "Package")"><i class="icon-chevron-right"></i> Manage Packages</a></li>
            <li@GetSelectedMenuClass(AdminMenu.ManageContents, selectedMenu)><a href="@Url.AdminUrl("List", "Content")"><i class="icon-chevron-right"></i> Manage Contents</a></li>            
            <li@GetSelectedMenuClass(AdminMenu.SearchConfig, selectedMenu)><a href="@Url.AdminUrl("Index", "SearchConfig")"><i class="icon-chevron-right"></i> Manage Search</a></li>
            <li@GetSelectedMenuClass(AdminMenu.Settings, selectedMenu)><a href="@Url.AdminUrl("Index", "Settings")"><i class="icon-chevron-right"></i> Settings</a></li>
        }
        else if (UserInfo.IsJobSeeker)
        {
            JobSeekerMenu selectedMenu = JobSeekerMenu.None;
            if (ViewData[AppConstants.ViewDataKeys.SELECTED_MENU] != null)
            {
                selectedMenu = (JobSeekerMenu)ViewData[AppConstants.ViewDataKeys.SELECTED_MENU];
            }     
            <li@GetSelectedMenuClass(JobSeekerMenu.Dashboard, selectedMenu)><a href="@Url.JobSeekerUrl("Dashboard", "Account")"><i class="icon-chevron-right"></i> Dashboard</a></li>
            <li@GetSelectedMenuClass(JobSeekerMenu.Profile, selectedMenu)><a href="@Url.JobSeekerUrl("profileedit", "home")"><i class="icon-chevron-right"></i> Your Profile</a></li>
            <li@GetSelectedMenuClass(JobSeekerMenu.Coverletter, selectedMenu)><a href="@Url.JobSeekerUrl("list", "coverletter")"><i class="icon-chevron-right"></i> Manage Coverletter</a></li>
            <li@GetSelectedMenuClass(JobSeekerMenu.Resume, selectedMenu)><a href="@Url.JobSeekerUrl("list", "resume")"><i class="icon-chevron-right"></i><span class="badge pull-right" id="spanResumeCount">@SessionCache.CurrentUser.JobSeekerInfo.TotalResumes</span> Manage Your Resume</a></li>                    
            <li@GetSelectedMenuClass(JobSeekerMenu.FaboriteJobs, selectedMenu)><a href="@Url.JobSeekerUrl("favoritejobs", "job")"><i class="icon-chevron-right"></i><span class="badge pull-right" id="span_LM_Favorite_Jobs">@SessionCache.CurrentUser.JobSeekerInfo.FavoriteJobs</span> Favorite Jobs</a></li>
            <li@GetSelectedMenuClass(JobSeekerMenu.AppliedJobs, selectedMenu)><a href="@Url.JobSeekerUrl("appliedjobs", "job")"><i class="icon-chevron-right"></i><span class="badge pull-right">@SessionCache.CurrentUser.JobSeekerInfo.AppliedJobs</span> Applied Jobs</a></li>
            <li@GetSelectedMenuClass(JobSeekerMenu.InterviewRequests, selectedMenu)><a href="@Url.JobSeekerUrl("List", "InterviewRequest")"><i class="icon-chevron-right"></i> Interview Requests</a></li>
            @*<span class="badge badge-inverse pull-right">Black Badge</span>
            <span class="badge badge-info pull-right">Blueish Badge</span>*@
        }
    </ul>
}